﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entities;
using Datalayer;
using Common;

namespace Portal_KonTum
{
    public partial class PrintNews : System.Web.UI.Page
    {
        IQueryMgr iq;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BinData();
            }
        }
        void BinData()
        {
            string cateid = Request.QueryString["ID"];
            New ex = new New();
            iq = QueryMgr.GetDbInstance();
            try
            {
                Guid idc = new Guid();
                idc = MethodCommon.Get_Guid(cateid);
                ex = iq.News_GetNewByID(idc);

                lblcate.Text = ex.Category.CategoryName;
                lblContent.Text = ex.NewContent;
                lblFullname.Text = "Người đăng:" + ex.User.FullName + "- Ngày đăng:" + ex.CreateDate.ToString() + "- Số lượt xem:" + ex.Hit;
                lblIntro.Text = ex.NewIntro;
                lblTieude.Text = ex.NewTitle;
                if (ex.Source != "")
                {
                    lblSource.Text = "Theo " + ex.Source;
                }
            }
            catch (Exception exa)
            {
                Alert.Show(exa.ToString());
            }
        }
    }
}